<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/AW-LICENSE-COMMUNITY.txt
 * 
 * =================================================================
 *                 MAGENTO EDITION USAGE NOTICE
 * =================================================================
 * This package designed for Magento COMMUNITY edition
 * aheadWorks does not guarantee correct work of this extension
 * on any other Magento edition except Magento COMMUNITY edition.
 * aheadWorks does not provide extension support in case of
 * incorrect edition usage.
 * =================================================================
 *
 * @category   AW
 * @package    AW_Imagetest
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/AW-LICENSE-COMMUNITY.txt
 */
/**
 * Extra Downloads tab content General
 */
class AW_Imagetest_Block_Adminhtml_Catalog_Product_Edit_Tab_Imagetest_General
    extends Mage_Adminhtml_Block_Template
{
    /**
     * Template path
     */
    const TAB_GENERAL_TEMPLATE = "aw_imagetest/product/edit/tab/general.phtml";

    /**
     * This is constructor
     * Set General template
     */
    public function __construct()
    {        
        parent::__construct();
        $this->setTemplate(self::TAB_GENERAL_TEMPLATE);
    }

    /**
     * Get model of the product that is being edited
     * @return Mage_Catalog_Model_Product
     */
    public function getProduct()
    {        
        return Mage::registry('current_product');
    }

    /**
     * Check exists defined extradownloads title
     * @return boolean
     */
    public function getUsedDefault()
    {
        $default = Mage::getModel('catalog/product')->load($this->getProduct()->getId())->getImagetestEnabled();                
        return $this->getProduct()->getImagetestEnabled() == $default;
    }
}